Delivering auto-play media content element from cross origin resources

ABSTRACT

Systems and methods for delivering cross-site auto-play media are described herein. The server can receive, from a client device, a request for media content at a first domain embedded in a content element from a second domain. The request can include an identifier indicating that the client device is configured to restrict cross-domain redirection. The server can determine, responsive to identifying the identifier indicating that the client device is configured to restrict cross-domain redirection, that the request comprises a content type header having a first predetermined value. The server can generate, responsive to the determination, a response comprising the media content element in a body of the response. The server can transmit the response to the client device. Receipt of the response can cause the client device to extract the media content element from the body of the response and to render the media content element.

RELATED APPLICATIONS

The present application is a continuation of U.S. patent applicationSer. No. 16/344,731 filed Apr. 24, 2019, which is a National Stageapplication of International Application No. PCT/US17/66513, filed Dec.14, 2017, which claims the benefit of and priority to U.S. patentapplication Ser. No. 15/447,009, entitled “Delivering Auto-Play MediaContent Element from Cross Origin Resources,” filed Mar. 1, 2017, theentirety of which is incorporated by reference herein.

BACKGROUND

In a computer networked environment, such as the Internet, contentelements (e.g., webpages) may be rendered by an application (e.g., webbrowser) executing at a client device. Other content elements may beembedded within the primary content element (e.g., an inline frameelement embedded in a body element). These embedded content elements maybe received by the client device via the computer networked environmentfrom a server different from that of the primary content element.

SUMMARY

Under the Same-Origin Policy, web browsers may restrict contentoriginating from domains other than that of the primary content elementfor security purposes. The Same-Origin Policy may allow web browsers toaccess embedded content from different domains under circumstancesspecified under the Cross-Origin Resource Sharing (CORS) protocol. Theprotocol may allow web browsers to fetch certain types of contentoriginating across different domains, such as plain textual data(“text/plain”), multi-part form data (“x-www-form-urlencoded”), andapplication encoded form data (“application/x-www-form-urlencoded”)using specified methods (e.g., GET, HEAD, and POST). Under thesespecifications, the web browser operating on the client device can senda request to the server associated with the different domain to requestfor the content. In some implementations, the web browser may first senda preflight request (e.g., OPTIONS method) to the other domain of theembedded content to determine whether the domain is secure. The servercan send a response granting permission to the requested domain and mayspecify which actions may be taken. Once the permission is received, theweb browser may then send another request for the embedded content. Thepreflight request may allow for additional types of content to bereceived from and additional methods to be sent to the other domain.

One limitation with the CORS protocol may be that all domains in aredirect response (e.g., a 302 response) are to be restricted. Underthis specification, if the server attempts to return a redirect responsefor a domain different from that of the primary content, the responsemay be rewritten to block all domains. To resolve some of thesechallenges, the client device may be configured to add a parameter tothe request to signal to the server to return a success response withthe domain of the redirected content in the body of the response. Theserver may in turn send a response indicating success (e.g., 200response) with the domain of the other content in the body of theresponse. In this manner, the client device may extract the resourceaddress in the response and send another request with the resourcedomain to retrieve the corresponding content. Sending a success responseas opposed to a redirect response may bypass the restrictions specifiedby CORS for redirect responses.

While the CORS protocol allows display of content from differentsources, security protocols on client devices may still impair thisfunctionality. Certain types of web browsers may block auto-playing ofmedia content elements (e.g., HTML video content element embedded inanother content element) by default without explicit user-interaction.To circumvent this restriction, the web browser may be configured tosend a request for media content element with or without the parameteradded to signal the server. The content type header of the request maybe specified as textual or non-textual to flag to the server which typeof content the client device may be expecting. If the content typeheader is textual, the server may send a response with the domain of themedia content element in the body of the response. If the content typeheader is non-textual, the server may insert an encoded version of themedia content element in the body of the response. The encoding of themedia content element may be JAVASCRIPT code that the web browser cancompile and execute to form an HTML canvas element. Upon receipt, theclient device may extract the content of the body and decode the mediacontent element to render and automatically play on the primary contentelement.

At least one aspect is directed to a method of delivering cross-siteauto-play media. The data processing system can receive, from a clientdevice, a request for media content at a first domain embedded in acontent element from a second domain. The request can include anpredefined identifier indicating that the client device is configured torestrict cross-domain redirection. The data processing system candetermine, responsive to identifying the first domain as different fromthe second domain and to identifying the predefined identifierindicating that the client device is configured to restrict cross-domainredirection, that the request comprises a content type header having afirst predetermined value. The data processing system can generate,responsive to determining that the request comprises the content typeheader having the first predetermined value, a response comprising themedia content element in a body of the response. The data processingsystem can transmit the response to the client device. Receipt of theresponse can cause the client device to render the media content elementin the body of the response.

In some implementations, receiving the request for media content elementcan further include receiving the request for media content element, therequest including a device type identifier for the client device. Insome implementations, the data processing system can determine that theclient device is configured to restrict automatic rendering of the mediacontent element encoded in a first format based on the device typeidentifier. In some implementations, the data processing system cantranscode, responsive to determining that the client device is themobile device, the media content element from a first format to a secondformat. In some implementations, the client device may be configured torestrict automatic rendering of the media content element encoded in thefirst format and to permit rendering the media content element encodedin the second format.

In some implementations, the predefined identifier of the request caninclude an application type identifier for an application executing onthe client device. In some implementations, the data processing systemcan identify that the application type identifier for the applicationexecuting on the client device corresponds to a predesignatedapplication. In some implementations, the data processing system candetermine that the request comprises the content type header having thefirst predetermined value, responsive to identifying that theapplication type identifier corresponds to the predesignatedapplication.

In some implementations, the data processing system can search awhitelist for the first domain. The whitelist can specify a plurality ofdomains permitted with the embedded media content element. In someimplementations, generating the response can further include generatingthe response responsive to determining that the first domain is on thewhitelist.

In some implementations, the data processing system can receive, from asecond client device, a second request for media content element at athird domain embedded in a content element from a fourth domain. Thesecond request can include the predefined identifier indicating that thesecond client device is configured to restrict cross-domain restriction.In some implementations, the data processing system can determine,responsive to identifying the third domain as different from the fourthdomain and to identifying that the second request includes thepredefined identifier, that the second request comprises a content typeheader having a second predetermined value different from the firstpredetermined value. In some implementations, the data processing systemcan generate responsive to determining that the request comprises thecontent type header having the second predetermined value, a secondresponse comprising an address for requested media content element in abody of the second response and a status identifier indicating successin a header of the second response. In some implementations, the dataprocessing system can transmit the second response to the second clientdevice. Receipt of the second response can cause the second clientdevice to transmit a third request for the requested media contentelement to the extracted address.

In some implementations, the data processing system can determine,responsive to receiving the second request from the second clientdevice, that a number of redirect requests for the second client deviceis less than a predefined threshold. In some implementations,determining that the second request comprises the content type headertype having the second predetermined value can further includedetermining that the second request comprises the content type headertype having the second predetermined value, responsive to determiningthat the number of redirect requests is less than the predefinedthreshold. In some implementations, the second predetermined value ofthe content type header in the second response can indicate textualcontent. In some implementations, the first predetermined value of thecontent type header in the response can indicate non-textual content. Insome implementations, generating the response can further includegenerating the request including executable code in the body of theresponse to instantiate a media player.

At least one aspect is directed to a system for delivering cross-siteauto-play media. A response parser can be executed on a data processingsystem with one or more processors. The response parser can receive arequest for media content at a first domain embedded in a contentelement from a second domain. The request can include a predefinedidentifier indicating that the client device is configured to restrictcross-domain redirection. The response parser can determine, responsiveto identification of the first domain as different from the seconddomain and to identification of the predefined identifier indicatingthat the client device is configured to restrict cross-domainredirection, that the request comprises a content type header having afirst predetermined value. A response rewriter can be executed on thedata processing system. The response rewriter can generate, responsiveto determination that the request comprises the content type headerhaving the first predetermined value, a response comprising the mediacontent element in a body of the response, response rewriter cantransmit the response to the client device. Receipt of the response cancause the client device to render the media content element from thebody of the response.

In some implementations, the request can include a device typeidentifier for the client device. In some implementations, the requesthandler can determine that the client device is configured to restrictautomatic rendering of the media content element encoded in a firstformat based on the device type identifier. In some implementations, amedia encoder can be executed on the data processing system. The mediacoder can encode, responsive to the determination that the client deviceis the mobile device, the media content element from a first format to asecond format. The client device can be configured to restrict automaticrendering of the media content element encoded in the first format andto permit rendering the media content element encoded in the secondformat.

In some implementations, the predefined identifier of the request caninclude an application type identifier for an application executing onthe client device. In some implementations, the request handler canidentify that the application type identifier for the applicationexecuting on the client device corresponds to a predesignatedapplication. In some implementations, the request handler can determinethat the request comprises the content type header having the firstpredetermined value, responsive to the identification that theapplication type identifier corresponds to the predesignatedapplication.

In some implementations, the request handler can search whitelist forthe first domain. The whitelist can specify a plurality of domainspermitted with the embedded media content element. In someimplementations, the response rewriter can generate the responseresponsive to determining that the first domain is on the whitelist.

In some implementations, the request handler can receive a secondrequest for media content element at a third domain embedded in acontent element from a fourth domain. The second request can include thepredefined identifier indicating that the second client device isconfigured to restrict cross-domain restriction. In someimplementations, the request handler determine, responsive toidentification of the third domain as different from the fourth domainand to identifying that the second request includes the predefinedidentifier, that the second request comprises a content type headerhaving a second predetermined value different from the firstpredetermined value. In some implementations, the response rewriter cangenerate, responsive to the determination that the request comprises thecontent type header having the second predetermined value, a secondresponse comprising an address for requested media content element in abody of the second response and a status identifier indicating successin a header of the second response. In some implementations, theresponse rewriter can transmit the second response to the second clientdevice. Receipt of the second response can cause the second clientdevice to transmit a third request for the requested media contentelement to the extracted address identified in the body of the response.

In some implementations, the request handler can determine, responsiveto the receipt of the second request from the second client device, thata number of redirect requests for the second client device is less thana predefined threshold. In some implementations, the request handler candetermine that the second request comprises the content type header typehaving the second predetermined value, responsive to determining thatthe number of redirect requests is less than the predefined threshold.In some implementations, the second predetermined value of the contenttype header in the second response can indicate textual content. In someimplementations, the first predetermined value of the content typeheader in the response can indicate non-textual content. In someimplementations, the response rewriter can generate the requestincluding executable code in the body of the response to instantiate amedia player. In some implementations, the response can include a statuscode lacking a redirect code.

These and other aspects and implementations are discussed in detailbelow. The foregoing information and the following detailed descriptioninclude illustrative examples of various aspects and implementations,and provide an overview or framework for understanding the nature andcharacter of the claimed aspects and implementations. The drawingsprovide illustration and a further understanding of the various aspectsand implementations, and are incorporated in and constitute a part ofthis specification.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings are not intended to be drawn to scale. Likereference numbers and designations in the various drawings indicate likeelements. For purposes of clarity, not every component may be labeled inevery drawing. In the drawings:

FIG. 1 is a process diagram depicting one implementation of deliveringcross-site auto-play media in a computer network environment, accordingto an illustrative implementation;

FIG. 2 is a block diagram depicting one implementation of a system fordelivering cross-site auto-play media in a computer network environment,according to an illustrative implementation;

FIGS. 3A-3C are flow diagrams depicting a method of deliveringcross-site auto-play media, according to an illustrative implementation;and

FIG. 4 is a block diagram illustrating a general architecture for acomputer system that may be employed to implement elements of thesystems and methods described and illustrated herein, according to anillustrative implementation.

DETAILED DESCRIPTION

Following below are more detailed descriptions of various conceptsrelated to, and implementations of, methods, apparatuses, and systems ofdelivering cross-site auto-play media in a computer network environment.The various concepts introduced above and discussed in greater detailbelow may be implemented in any of numerous ways, as the describedconcepts are not limited to any particular manner of implementation.

Under the Same-Origin Policy, web browsers may restrict contentoriginating from domains other than that of the primary content elementfor security purposes. The Same-Policy Policy may allow web browsers toaccess embedded content from different domains under circumstancesspecified under the Cross-Origin Resource Sharing (CORS) protocol. Theprotocol may allow web browsers to fetch certain types of contentoriginating across different domains, such as plain textual data(“text/plain”), multi-part form data (“x-www-form-urlencoded”), andapplication encoded form data (“application/x-www-form-urlencoded”),among others, using specified methods (e.g., GET, HEAD, and POST). Usingthese specifications, the web browser operating on the client device cansend a request (“simple request”) to the server associated with thedifferent domain to request for the content. In addition, the webbrowser may first send a preflighted request (e.g., OPTIONS method) tothe other domain of the embedded content determine whether the domain issecure. The server can send a response granting permission to therequested domain and may specify which actions may be taken. Once thepermission is received, the web browser may then send another requestusing one of the specified methods for the embedded content. Thepreflight request may allow for additional types of content andadditional methods to be sent to the other domain.

One limitation with the CORS protocol may be that all domains in aredirect response (e.g., a 302 response) are to be restricted. Underthis specification, if the server attempts to return a redirect responsefor a domain different from that of the primary content, the responsemay be rewritten to block all domains. To resolve some of thesechallenges, the client device may be configured to add a parameter tothe request to signal to the server to return a success response withthe domain of the redirected content in the body of the response. Theserver may in turn send a response indicating success (e.g., 200response) with the domain of the other content in the body of theresponse. In this manner, the client device may extract the resourceaddress in the response and send another request with the resourcedomain to retrieve the corresponding content. Sending a success responseas opposed to a redirect response may bypass the restrictions specifiedby CORS for redirect responses.

While the CORS protocol allows display of content from differentsources, security protocols on client devices may still impair thisfunctionality. Certain web browsers may block auto-playing of mediacontent elements (e.g., HTML video content element embedded in anothercontent element) by default without explicit user-interaction. Toaddress these and other technical challenges, a script executing on theclient device and a request handler running on the server may beconfigured to generate and exchange data to facilitate auto-playablemedia content elements.

Referring to FIG. 1 , depicted is a signal flow diagram depicting oneimplementation of a process 100 for delivering cross-site auto-playmedia in a computer network environment. In the depicted process 100, anagent (e.g., web browser, plug-in, agent, service, etc.) executing on aclient device 105 may be configured to restrict or block loading ofembedded content elements originating from a domain different from aprimary content element in a redirect response pursuant to the CORSprotocol. The agent of the client device 105 may also be configured forblocking of auto-playable media content elements of a specific contenttype (e.g., HTML video content elements). To resolve both constraints,in some implementations, a script may be provided to the client device105 to configure the agent executing thereon to generate requests andparse responses in a manner specified by the script. The script may bereceived by the client device 105 with the embedded content element orwith the primary content element, or separate from both the embeddedcontent element and the primary content element (e.g. with a web page,CSS stylesheet, etc.). A request handler running on a server 110 (e.g.,data processing system) may also be configured to parse responses fromthe client device 105 and generate responses to allow the client device105 to auto-play the media content element.

In a first step of process 100, the client device 105 may generate andtransmit an initial request 115. In generating the initial request 115,the client device 105 may determine that a domain of the embedded mediacontent element differs from a domain of the primary content element,signaling that the request 115 is to be in conformance to the CORSprotocol. In response to this determination, the client device 105 maygenerate the request 115 (e.g., a POST, GET, or OPTIONS request). Theclient device 105 may set a host header 120A to the domain of theembedded media content element (e.g., “Address A”) to direct the request105 to the server 110 associated with the domain. The server 110 may bedifferent from the server that provided the client device 105 with theprimary content element. The client device may further set a contenttype header 1206 to textual (e.g., “text/plain”) to indicate to theserver 110 which type of content the client 105 is requesting. Theclient device 105 may also include a parameter in the request 115 (e.g.,in the hostname of the header 120A, in an options field, in aparameter-value pair of a URL, etc.) to signal to the server 110 thatthe client device 105 may be expecting the redirect address in the bodyof a response. The request 115 may then be sent by the client device 105to the server 110 corresponding to the address of the embedded mediacontent element for redirection to a third party content server.

Upon receipt of the request, server 110 can receive and parse therequest 115. The server 110 can identify the address of the embeddedmedia content element from the host header 120A. The server 110 candetermine that the client device 105 is to be redirected to anotheraddress (e.g. of a third party content server) based on the request 115,such as by using the parameter added to the request 1 15, based on thecontent type header 120B set to “text,” or based on the address includedin the host header 120 A. Based on the determination, the server 110 canidentify the second address (e.g., “Address B”) that the client device105 is to be redirected to. The second address may include the same hostname as the first address included in the host header 120 A of therequest 115. The server 110 can generate a response 125. Rather thanincluding a redirection status code (e.g., 302 found), the server 110can set a status code header 130A of the response 125 to success (e.g.,200 OK). The server 110 can include the other address to which theclient device 105 is to be redirected to in the body 130B of theresponse 125. The response 125 may then be sent to the client device105.

Upon receipt of the response 125, the client device 105 may parse theresponse 125 to identify the redirect address (e.g., “Address B”) in thebody 130B of the response 125. As the status code header 130 of theresponse 125 indicates success as opposed to a redirect (e.g. code 302),the client device 105 may be able to access content from the domaindifferent from that of the primary content element, bypassing therestrictions regarding redirect responses in the CORS protocol: browsersecurity settings that would be triggered by the 302 redirect code arenot triggered by the OK 200 code. The response 125 set to the successmay also allow the client device 105 to send additional requests toservers of domains besides that of the primary content element. Theclient device 105 may in turn generate a second request 135 (e.g., usingthe POST method). In the request 135, the client device 105 may set ahost header 140A to include the redirect address (e.g., “Address B”)referring to the address of the media content element. The client device105 may also set a content type header 140B to “non-textual” or asimilar setting to indicate to the server 110 that the client device 105may be expecting data for the embedded media content element. The clientdevice 105 may further add another parameter in the request 135 tosignal to the server 110 that the client device 105 was redirected tothe other address. The request 135 may then be transmitted by the clientdevice 105 to the server 110. It should be noted that the client device105 can send any number of requests with the content type header set to“textual” prior to sending a request with the content type header set to“non-textual”.

Having obtained the second request 135, the server 110 can parse therequest 135 and identify the two headers 140 A and 140B of the request135. The server 110 can identify the content type header 140B as set to“non-textual” signaling that the client device 105 may be expecting theembedded content element, rather than a redirect response. In responseto the identification of the content type header 140B as set to“non-textual”, the server 110 can identify the address included in thehost header 140 A. Using the address, the server 110 can access a mediacontent element database to obtain the media content element. The mediacontent element may be of a format that may be restricted by the webbrowser running on the client device 105, such as an HTML video contentelement. To circumvent the restriction, the server 110 can encode themedia content element in a different format (e.g., using JAVASCRIPT toform an HTML canvas content element). The server 110 can in turngenerate a response 145, set the status code header 150A to success(e.g. 200 OK), and insert the encoded media content element into thebody 150B. The response 145 can be transmitted to the client device 105.

Having received the response 145, the client device 105 can parse theresponse 145 to identify the encoded media content element from the body150B. Because the body of the response 150B includes the media contentelement encoded in a format not restricted from auto-play by the clientdevice 105, the client device 105 may automatically render and play theembedded media content element on the web browser. In the mannerdescribed in process 100, both the client device 105 and the server 110may be able to address or circumvent technical challenges and bypassrestrictions regarding restrictions to redirects under the CORS protocoland blocking of auto-playing of media content elements set by certainweb browsers.

Referring now to FIG. 2 , illustrated is a block diagram depicting oneimplementation of an environment for delivering cross-site auto-playmedia. The environment 200 includes the client device 105, the dataprocessing system 110, a network 205, a content provider device 210, anda content publisher device 215. In overview, each of the client device105, the data processing system 110, the content provider device 210,and the content publisher device 215 can communicate with one anothervia the network 205. The client device 105, the content providercomputing device 215, and the content publisher computing device 215 caninclude desktop computers, laptop computers, tablet computers,smartphones, personal digital assistants, mobile devices, consumercomputing devices, servers, clients, digital video recorders, a set-topbox for a television, a video game console, or any other computingdevice configured to communicate via the network 205.

The network 205 can include computer networks such as the internet,local, wide, metro or other area networks, intranets, satellitenetworks, other computer networks such as voice or data mobile phonecommunication networks, and combinations thereof. The data processingsystem 110 of the system 200 can communicate via the network 205, forinstance with the content provider computing device 215, the contentpublisher computing device 215, or the client device 105. The network205 may be any form of computer network that relays information betweenthe client device 105, data processing system 110, and one or morecontent sources, such as web servers, advertising servers, amongstothers. The network 205 may include the Internet and/or other types ofdata networks, such as a local area network (LAN), a wide area network(WAN), a cellular network, satellite network, or other types of datanetworks. The network 205 may also include any number of computingdevices (e.g., computer, servers, routers, network switches, etc.) thatare configured to receive and/or transmit data within network 205. Thenetwork 205 may further include any number of hardwired and/or wirelessconnections. In some implementations, the client device 105 maycommunicate wirelessly (e.g., via WiFi, cellular, radio, etc.) with atransceiver that is hardwired (e.g., via a fiber optic cable, a CAT5cable, etc.) to other computing devices, such as the data processingsystem 110, the content provider device 210, and the content publisherdevice 215, in network 205.

The content provider computing device(s) 210 can include servers orother computing devices operated by a content provider entity to providecontent elements for display on primary content elements at the clientdevice 105. The content provided by the content provider computingdevice 215 can include embedded content elements for display on primarycontent elements (e.g., a webpage), such as a website or web page thatincludes primary content, e.g., content provided by the contentpublisher computing device 215. The content elements can also bedisplayed on a search results web page. In some implementations, thecontent provider computing device 215 can provide or be the source ofcontent elements for display in content slots of primary contentelements, such as a web page of a company where the primary content ofthe web page is provided by the company, or for display on a searchresults landing page provided by a search engine. The content elementsassociated with the content provider computing device 215 can bedisplayed on primary content elements other than web pages, such ascontent displayed as part of the execution of an application on asmartphone or other client device 105. In some implementations, thecontent provider computing device 210 can include a server for servingmedia content elements, such as video content elements.

The content publisher computing device(s) 215 can include servers orother computing devices operated by a content publishing entity toprovide primary content element for display via the network 205. Thecontent publisher computing device 215 can include a web page operatorwho provides primary content for display on the web page. The primarycontent can include content other than that provided by the contentpublisher computing device 215, and the primary content element caninclude content slots configured for the display of embedded contentelements from the content provider computing devices 210. For instance,the content publisher computing device 215 can operate the website of acompany and can provide content about that company for display on webpages of the website. The web pages can include content slots configuredfor the display of embedded content elements such as ads of the contentprovider computing device 215. In some implementations, the contentpublisher computing device 215 includes a search engine computing device(e.g. server) of a search engine operator that operates a search enginewebsite. The primary content element of search engine web pages (e.g., aresults or landing web page) can include results of a search as well asembedded content elements displayed in content slots such as embeddedcontent elements from the content provider computing device 215. In someimplementations, the content publisher computing device 215 can includea server for serving media content elements, such as video contentelements.

The content provider computing device(s) 210 and the content publishercomputing device(s) 215 can each include a processor and a memory. Thememory stores machine instructions that, when executed by processor,cause processor to perform one or more of the operations describedherein. The processor may include a microprocessor, application-specificintegrated circuit (ASIC), field-programmable gate array (FPGA), etc.,or combinations thereof. The memory may include, but is not limited to,electronic, optical, magnetic, or any other storage or transmissiondevice capable of providing the processor with program instructions. Thememory may further include a floppy disk, CD-ROM, DVD, magnetic disk,memory chip, ASIC, FPGA, read-only memory (ROM), random-access memory(RAM), electrically-erasable ROM (EEPROM), erasable-programmable ROM(EPROM), flash memory, optical media, or any other suitable memory fromwhich the processor can read instructions. The instructions may includecode from any suitable computer-programming language.

The content provider computing device(s) 210 and the content publishercomputing device(s) 215 may also include one or more user interfacedevices. In general, a user interface device may include any electronicdevice that conveys data to a user by generating sensory information(e.g., a visualization on a display, one or more sounds, etc.) and/orconverts received sensory information from a user into electronicsignals (e.g., a keyboard, a mouse, a pointing device, a touch screendisplay, a microphone, etc.). The one or more user interface devices maybe internal to a housing of the content provider computing device(s) 210and the content publisher computing device(s) 215 (e.g., a built-indisplay, microphone, etc.) or external to the housing of contentprovider computing device(s) 210 and the content publisher computingdevice(s) 215 (e.g., a connected monitor, or a connected speaker, etc.),according to various implementations. The content provider computingdevice(s) 210 and the content publisher computing device(s) 215 may eachinclude an electronic display, which visually displays web pages usingwebpage data received from one or more content sources and/or from thecomputing devices connected via the network 205.

The data processing system 110 can include can include at least oneprocessor 220, a network interface 225, and a memory 230. The processor220, the network interface 225, and the memory 230 may be those detailedbelow in conjunction with FIG. 4 . The memory 230 storesprocessor-executable instructions that, when executed by processor 220,cause the processor to perform one or more of the operations describedherein. The processor 220 may include a microprocessor,application-specific integrated circuit (ASIC), field-programmable gatearray (FPGA), etc., or combinations thereof. The memory 230 may include,but is not limited to, electronic, optical, magnetic, or any otherstorage or transmission device capable of providing the processor withprogram instructions. The memory 230 may further include a floppy disk,CD-ROM, DVD, magnetic disk, memory chip, ASIC, FPGA, read-only memory(ROM), random-access memory (RAM), electrically-erasable ROM (EEPROM),erasable-programmable ROM (EPROM), flash memory, optical media, or anyother suitable memory from which the processor can read instructions.The instructions may include code from any suitable computer-programminglanguage. The network interface 225 may be used by the processor 220 tocommunicate with computing devices connected to the network 205. Thedata processing system 110 can include one or more computing devices orservers that can perform various functions.

The data processing system 110 can include one or more servers. In someimplementations, the data processing system 110 can include a pluralityof servers located in at least one data center or server farm. The dataprocessing system 110 can include a request handler 264, a responserewriter 266, a media encoder 268, a media address database 270, and amedia content element database 272. In some implementations, each of therequest handler 264, the response rewriter 266, the media encoder 268,the media address database 270, and the media content element database272 may be instructions or other data residing on the memory 230 forexecution by the processor 230. In some implementations, each of therequest handler 264, the response rewriter 266, and the media encoder268 can include at least one processing unit, server, virtual server,circuit, engine, agent, appliance, or other logic device such asprogrammable logic arrays configured to communicate with the mediaaddress database 270 and the media content element database 272 and withother computing devices (e.g., the content provider computing device215, the content publisher computing device 215, or the client device105) via the network 205.

In some implementations, the request handler 264, the response rewriter266, and the media encoder 268 can include or execute at least onecomputer program or at least one script. The request handler 264, theresponse rewriter 266, and the media encoder 268 can be separatecomponents, a single component, or part of the data processing system110. The request handler 264, the response rewriter 266, and the mediaencoder 268 can include combinations of software and hardware, such asone or more processors (e.g., the processor 220 and the memory 230)configured to execute one or more scripts.

The data processing system 110 can also include one or more contentrepositories or databases, such as the media address database 270 andthe media content element database 272. The databases can be local tothe data processing system 110. In some implementations, the databasescan be remote to the data processing system 110 but can communicate withthe data processing system 110 via the network 205. The media addressdatabase 270 can include a redirect address 256′ referencing an embeddedmedia content element. The redirect address 256′ may be used to redirector forward the client agent 252 from one address to the addressindicated by the media address database 270 to retrieve the embeddedmedia content element. The redirect address 256′ of the embedded mediacontent element may have a host name corresponding to the dataprocessing system 110. The media content element database 272 caninclude the embedded media content elements identified by the address.In some implementations, the embedded media content elements may be of aformat prevented from auto-playing at the client device 105. Additionaldetails of the contents of the media address database 270 and the mediacontent element database 272 are described below.

The client device 105 can include a processor 235, an input/output (I/O)interface 245, a network interface 240, and a memory 250. The processor235, the I/O interface 245, the network interface 240, and the memory250 may be those detailed below in conjunction with FIG. 4 (e.g.,processor 420, communication interface 405, input device 415 and inputdevice 410, and memory 425 of the computer system 400 respectively. Thememory 230 may include instructions and other data to be executed by theprocessor 235. The memory 230 can include a client agent 252, such as aweb-browser, mobile application, or any other computing program forparsing and rendering content elements received via the network 205 atthe client device 105. The client agent 252 can include a primarycontent element 254. The primary content element 254 can include one ormore scripts such as an address 256 (e.g., an address or domain) to anembedded media content element 256″, a request writer 258, a responseparser 260, and a media decoder 262. The primary content 254 mayinitially lack the embedded media content element 256″ (indicated bydotted lines in FIG. 2 ). In some implementations, the primary contentelement 254 may include a content element container (e.g., inline frame)for the embedded media content element 256″ with the address 256 priorto loading. In some implementations, the request writer 258, theresponse parser 260, and the media decoder 262 may be part of the clientagent 252 separate from the primary content element 254. In someimplementations, the request writer 258, the response parser 260, andthe media decoder 262 can be part of the container for the embeddedmedia content element 256″. In some implementations, the media decoder262 may be provided at a time different from the provisioning of therequest writer 258 and the response parser 260. The client devices 105can include computing devices configured to communicate via the network205 to display data such as the content provided by the contentpublisher computing device 215 (e.g., primary content element 254) andthe content provided by the content provider computing device 215 (e.g.,content elements such as the embedded media content element 256″ to beembedded in the primary content element 254).

A client agent 252 executing on a client device can receive the primarycontent element 254 from the content publisher device 215, or anotherserver. The primary content element 254 may be referenced by an address,such as one following the Uniform Resource Locator (URL) syntax. Theaddress may include a domain name and a path. The domain name may beassociated with or particular to the content publisher device 215. Thepath may refer to the particular primary content element 254 hosted bythe content publisher device 215.

In addition, the client agent 252 can parse the primary content element254 to identify additional content elements. In some implementations,the client agent 252 can identify a content element to be embedded intothe primary content element 254. The client agent 252 can identify thereference for the embedded content element, such as a reference 256 tothe embedded media content element 256″ (e.g., HTML video or audiocontent element) in the primary content element 254. The address 256 forthe embedded media content element 256″ may include a domain name and apath name. The domain name may reference a server different from thecontent publisher device 215, such as the data processing system 110.The client agent 252 can determine whether the domain name of theprimary content element 254 differs from the domain name of the address256. If the domain name of the primary content element 254 does notdiffer from the domain name of the address 256, the client agent 252 cancommunicate requests and responses with the content publisher device 215without triggering any of the restrictions specified by the CORSprotocol. On the other hand, if the domain name of the primary contentelement 254 differs from the domain name of the address 256, futurerequests and responses between the client agent 252, the data processingsystem 110, and the content publisher device 215 may be subject to therestrictions specified by the CORS protocol.

Content in addition to the primary content element 254 may be restrictedby the content agent 252. In some implementations, the client agent 252may be configured to restrict the auto-playing of embedded media contentelements of specific formats (e.g., HTML video content elements, audiocontent elements, and track content elements, etc.), by default. Theclient agent 252 may be configured to restrict the auto-playing ofembedded media content elements based on a device type of the clientdevice 105 (e.g., mobile device). In some implementations, the clientagent 252 may also be configured to limit such additional contentelements or the functionality thereof under the Same-Origin Policy andthe CORS protocol, if the client agent 252 determines that theadditional content elements are from a domain different from that of theprimary content element 254. In addition, the client agent 252 may beconfigured to block additional content from a server that has returned aredirect response (e.g., with the 302 status code). The functionalitiesprovided by the request rewriter 258 and the media decoder 262 mayresolve both restrictions.

To retrieve the embedded content element 256″, the request writer 258executing on the client device 105 can generate an initial request 115.The initial request may include one or more headers and a body. Theinitial request 115 may be an HTTP request using the OPTION method orPOST method, among other methods. With the OPTION method or the POSTmethod, the request writer 258 can set an origin header of the initialrequestl 15 to the domain name of the primary content element 254. Therequest writer 258 can set an host header of the initial request 115 tothe address 256 of the embedded media content element 256″.

The request writer 258 can include or insert a predefined identifier asa redirection indicator into the initial request 115. The predefinedidentifier may indicate to the data processing system 110 that theclient agent 252 is configured to restrict cross-domain redirection. Thepredefined identifier may indicate to the data processing system 110that the client agent 252 may be expecting another address to beredirected to. In some implementations, the request writer 258 canappend the predefined identifier to the address 256 of the embeddedmedia content element 256″.

To signal to the data processing system 110 whether the client agent 252may be expecting another address to be redirected to, the request writer258 can set a content type header of the initial request 115 to textual(e.g., “text/plain” or “text/html”, etc.). In some implementations, therequest writer 258 can determine whether the initial request 115 is thefirst request for the embedded media content element 256″ to the dataprocessing system 110. In some implementations, the request writer 258can maintain a counter on the memory 250 of the client device 105 totrack a number of requests for the embedded media content element 256″with the corresponding address. If the counter is greater than one, insome implementations, the request writer 258 can determine that therequest is not the first request to be transmitted for the embeddedmedia content element 256″. If the counter is zero, the request writer258 can determine that the request is the first request to betransmitted for the embedded content element 256″. In someimplementations, the request writer 258 can compare the address 256 ofthe embedded media content element 256″ with the address maintained bythe counter. If the addresses match, the request writer 258 can identifythe number of requests from the counter maintained on the memory 250. Ifthe request writer 258 determines that the number of requests is zero ordetermines that the addresses do not match, in some implementations, therequest writer 258 can set the content type header of the initialrequest 115 to textual. In some implementations, the request writer 258can include the number of requests into the predefined identifier. Therequest writer 258 can then relay the generated request 115 to theclient agent 252 to transmit to the data processing system 110 via thenetwork interface 240 of the client device 105.

Once the initial request 115 is received at the data processing system110 side, the request handler 264 can determine which type of responsethe client device 105 may be expecting. In some implementations, therequest handler 264 can parse the initial request 115. In someimplementations, the request handler 264 can identify the address of theprimary content element 254 from the origin header of the initialrequest 115. In some implementations, the request handler 264 canidentify the address 256 of the embedded media content element 256″ fromthe host header of the initial request 115. In some implementations, therequest handler 264 can extract the domain name of the primary contentelement 254 from the origin header of the initial request 115. In someimplementations, the request handler 264 can extract the domain name ofthe embedded media content element 256″ from the host header of theinitial request 115. With the parsing of the initial request 115, therequest handler 264 can compare the domain name of the primary contentelement 254 with the domain name of the embedded media content element256″.

If the request handler 264 determines that the domain name of theprimary content element 254 does not differ from the domain name of theaddress 256 for the embedded content element 256″, the lack ofdifference between the two domain names may imply that the dataprocessing system 110 may be the same device that provided the clientdevice 105 with the primary content element 254. As such, the requestsand responses transmitted between the client device 105 and the dataprocessing system 110 may not be subject to the restrictions specifiedby the CORS protocol. The request handler 264 may parse the initialrequest 125 for the address 256. The response rewriter 266 can use theaddress 256 to search for the embedded media content element 256″ fromthe media content database 272. In some implementations, the responserewriter 266 can in turn transmit the embedded media content element256″ in the subsequent response to the client agent 252. In someimplementations, the client agent 252 in turn can render and play theembedded media content element 256″.

If the request handler 264 determines that the domain name of theprimary content element 254 differs from the domain name of the address256 for the embedded content element 256″, the request handler 264 candetermine whether the client agent 252 is configured to restrictcross-domain redirection based on the initial request 115. In someimplementations, the request handler 264 can further parse the initialrequest 115 to identify the predefined identifier to determine whetherthe client agent 262 is configured to restrict cross-domain redirection.Based on identifying the predefined identifier, the request handler 264can determine that the client agent 252 is configured to restrictcross-domain redirection. In some implementations, the request handler264 can also determine that the client agent 252 may be expecting aredirection address 256′ for the embedded media content element 256″.

In some implementations, once the request handler 264 determines thatthe domain name of the primary content element 254 differs from thedomain name of the address 256 for the embedded content element 256″,the request handler 264 may access a whitelist of domain names to searchfor the domain name of the primary content element 254. In someimplementations, the whitelist of domain names may specify which domainsare permitted to be shown with the embedded content element 256″. Thewhitelist of domain names may be maintained on the memory 230 or at adatabase connected to the data processing system 110. If the requesthandler 264 finds the domain name of the primary content element 254 onthe whitelist of domain names, the request handler 264 may continueparsing the request (e.g., the initial request 115) in the mannerdetailed herein. If the request handler 264 does not find the domainname of primary content element 254 on the whitelist of domain names,the request handler 264 may prohibit the embedded media content element256″ to be provided to the client device 105 and may terminate furtherprocessing of the request. In this manner, security of the client agent252 executing on the client device 105 may be maintained, while allowingthe client agent 252 to access content from certain domains differentfrom those of the primary content element 254.

In some implementations, the request handler 264 can parse the initialrequest 115 to identify an application profile of the client agent 252(e.g., which type of web browser) to determine whether the client agent252 is configured to restrict cross-domain redirection. The requesthandler 264 can compare the application profile of the client agent 262to a list of applications configured to restrict cross-domainredirection. The list of applications may be accessed by the requesthandler 264 from the memory 230 or another database connected to thedata processing system 110. If the application profile of the clientagent 252 matches one of the applications of the list of applications,the request handler 264 can determine that the client agent 252 isconfigured to restrict cross-domain redirection. The request handler 264can also determine that the client agent 252 may be expecting aredirection address 256′ for the embedded media content element 256″. Ifthe application profile of the client agent 252 does not match any ofthe applications on the list of applications, the request handler 264can determine that the client agent 252 is not configured to restrictcross-domain redirection.

In some implementations, the request handler 264 can parse the initialrequest 115 to identify a device type of the client device 105 (e.g.,whether the client device 105 is a smart phone, laptop, or desktop,etc.) in determining whether the client agent 252 is configured torestrict cross-domain redirection. The request handler 264 can comparethe device type of the client device 105 to a list of device typesconfigured to restrict cross-domain redirection. The list of devicetypes may be accessed by the request handler 264 from the memory 230 oranother database connected to the data processing system 110. If thedevice type of the client device 105 matches one of the device types ofthe list of device types, the request handler 264 can determine that theclient agent 252 configured to restrict cross-domain redirection. Therequest handler 264 can also determine that the client agent 252 may beexpecting a redirection address 256′ for the embedded media contentelement 256″. If the device type of the client device 105 does not matchany of the device types on the list of device types, the request handler264 can determine that the client agent 252 is not configured torestrict cross-domain redirection.

If the request handler 264 determines that the client agent 252 is notconfigured to restrict cross-domain redirection, the request handler 264can parse the initial request 125 for the address 256. The responserewriter 266 can use the address 256 to search for the embedded mediacontent element 256″ from the media content database 272. The responserewriter 266 can in turn transmit the embedded media content element256″ included in the subsequent response to the client agent 252. Theclient agent 252 in turn can render and play the embedded media contentelement 256″.

If the request handler 264 determines that the client agent 252 isconfigured to restrict cross-domain redirection and/or that the clientagent 252 may be expecting a redirection address 256′, the requesthandler 264 can determine which type of response the client agent 252may be expecting based on the content type header of the receivedrequest (e.g., the initial request 115 or terminal request 135). In someimplementations, the request handler 264 can parse the initial request115 to identify the content type header. The content type header mayindicate which type of content in the body of the response the clientagent 252 may be expecting. As explained above, the content type headermay specify textual or non-textual content. If the request handler 264identifies that the content type header of the request specifies textual(such as the case with the initial request 115), the request handler 264can determine that the client agent 252 may be expecting the redirectaddress 256′ for the embedded media content element 256″. In someimplementations, the request handler 264 can determine which type ofmethod the initial request 115 corresponds to (e.g., OPTION or POST) toidentify which type of response the client agent 252 may be expecting.If the method of the initial request is OPTION (e.g., a preflightrequest under CORS), the request handler 264 may determine that theclient agent 252 may be expecting the redirect address 256′ for theembedded media content element. The operation of the request handler 264in response to identifying the content type header of the request asnon-textual (such as the case with the terminal request 135) isdescribed in more detail below.

Once the request handler 264 identifies the content type header of therequest as specifying textual content (e.g., initial header 115), therequest handler 264 can relay, signal, or otherwise cause the responserewriter 266 to generate the initial response 125 to counteract therestriction of cross-domain redirection. Under the CORS specification,if the data processing 110 were to attempt to issue a response with aredirect status code including an address for embedded content with adomain different from that of the primary content element 254, theorigin header of the response may be set to null, thereby restrictingall domains in the redirect response. The redirect status code mayinclude 301 multiple choices, 301 moved permanently, 302 found, 303 seeother, 304 not modified, 305 use proxy, 307 temporary redirect, or 308permanent redirect. To bypass the restrictions of the CORS specificationconcerning responses with a redirect status code, the response rewriter266 can generate a response lacking such a redirect status code.

In some implementations, the response rewriter 266 can generate theinitial response 125. The response rewriter 266 can set a header and abody of the initial response 125. The header of the initial response 125can be set to include a status code indicating success (e.g., 200 OK).In some implementations, the header of the initial response 125 can beset to include a content type header indicating textual (e.g.,“text/plain,” and “text/html”, among others). To set the body of theinitial response 125, the response rewriter 266 can access the mediaaddress database 270 to search for the redirect address 256′corresponding to the address 256 for the embedded content element 256″.The redirect address 256′ may be used by the client agent 252 to issueand transmit another request to the data processing system 110 for theembedded content element 256″. Once the redirect address 256′ isidentified, the response rewriter 266 can set, insert, or write theredirect address 256′ into the body of the initial response 125. Theresponse rewriter 266 can transmit the initial response 125 via thenetwork interface 225 to the client device 105. Receipt of the initialresponse 125 may cause the client agent 252 to extract the redirectaddress 256′ from the initial response 125 and to transmit anotherrequest with the redirect address 256′.

In some implementations, the response rewriter 266 can identify thenumber of requests in the request from the client agent 252, as thereceived request may be part of a chain of requests and responses forthe embedded media content element 256″. In some implementations, theresponse rewriter 266 can maintain a counter on the memory 230 or at ona database connected to the response rewriter 266 to track the number ofredirects for the embedded media content element 256″ for the clientagent 252. In response to receiving the request, the response rewriter266 can update or increment the counter for the number of redirects. Insome implementations, the response rewriter 266 can include the numberof redirects in the response. In some implementations, the number ofredirects may be appended to the redirect address 256′ (e.g., at the endof the URL for the redirect address 256′). In some implementations, theresponse rewriter 266 can compare the number of redirects to a maximumnumber of redirects. If the response rewriter 266 determines that thenumber of redirects is greater than or equal to the maximum number ofredirects, the response rewriter 266 can set the response to indicatefailure to retrieve content (e.g., using a 5xx error code). If theresponse rewriter 266 determines that the number of redirects is lessthan the maximum number of redirects, the response rewriter 266 accessthe media access database 270 to search for the redirect address 256′and insert the redirect address 256′ into the body of the response. Insome implementations, the response rewriter 266 can further transmit theresponse with the number of redirects via the network interface 225 tothe client device 105.

In response to receiving the response with the redirect address 256′(e.g., initial response 125) from the data processing system 110 at theclient device 105, the response parser 260 can parse the response. Asthe response may include a status code indicating success (e.g., 200 OK)as opposed to redirect (e.g., 302 found), the client agent 252 may befree from the restrictions specified by the CORS protocol and may accessthe content of a domain different form that of the primary contentelement 252 in the redirect chain. The response parser 260 can parse theinitial response 125 (or another response) to extract the body of theinitial response 125. The response parser 260 can determine whether thebody of the initial response 125 includes the redirect address 256′ oranother type of content, such as the embedded media content element 256″as will be discussed later herein. The response parser 260 can parse theinitial response 125 to extract or otherwise identify the redirectaddress 256′. In some implementations, the response parser 260 can parsethe initial response 125 to identify the status code indicating success.In response to identifying the status code indicating success, theresponse parser 260 can extract the redirect address 256′ from theinitial response 125. In some implementations, the response parser 260can parse the initial response 125 to identify the content type header.If the content type header of the initial response 125 indicatestextual, the response parser 260 can extract the redirect address 256′from the initial response 125. In some implementations, the responseparser 260 can relay the redirect address 256′ to the request writer258.

With the redirect address 256′ parsed from the initial response 125, therequest writer 258 may generate a request (e.g., the terminal request135). The terminal request 135 may include one or more headers and abody. The terminal request 135 may be an HTTP request using the POST orGET method, among other methods. With the POST or the GET method, therequest writer 258 can set an origin header of the terminal request 135to the domain name of the primary content element 254. The requestwriter 258 can set an host header of the terminal request 135 to theredirect address 256′ for the embedded media content element 256″received from the data processing system 110.

To signal to the data processing system 110 whether the client agent 252is expecting the embedded media content element 256″, the request writer258 can set a content type header of the terminal request 135 tonon-textual (e.g., application, video, JSON, etc.). The request writer258 can include or insert a predefined identifier as a redirectionindicator into the terminal request 135. The predefined identifier mayindicate to the data processing system 110 that the client agent 252 isconfigured to restrict cross-domain redirection. In someimplementations, the request writer 258 can append the predefinedidentifier to the redirect address 256′ of the embedded media contentelement 256″. In some embodiments, the request writer 258 can update orincrement the counter for keeping track of the number of requests forthe embedded content element 256″. The request writer 268 can includethe number of requests into the terminal request 135. In someimplementations, the request writer 268 can append the number ofrequests onto the redirect address 256′ in the host header. The requestwriter 258 can then relay the generated request 125 to the client agent252 to transmit to the data processing system 110 via the networkinterface 240 of the client device 105.

Once the terminal request 135 (or request subsequent to the initialrequest 115) is received at the data processing system 110 side, therequest handler 264 can again determine which type of response theclient device 105. The request handler 264 can parse the terminalrequest 135. The request handler 264 can identify the address of theprimary content element 254 from the origin header of the terminalrequest 135. The request handler 264 can identify the redirect address256′ for the embedded media content element 256″ from the host header ofthe terminal request 135. In some implementations, the request handler264 can extract the domain name of the primary content element 254 fromthe origin header of the terminal request 135. In some implementations,the request handler 264 can extract the domain name of the embeddedmedia content element 256″ from the host header of the terminal request135. With the parsing of the terminal request 135, the request handler264 can compare the domain name of the primary content element 254 withthe domain name of the embedded media content element 256″.

If the request handler 264 determines that the domain name of theprimary content element 254 does not differ from the domain name of theaddress 256 for the embedded content element 256″, the lack ofdifference between the two domain names may imply that the dataprocessing system 110 may be the same device that provided the clientdevice 105 with the primary content element 254. As such, the requestsand responses transmitted between the client device 105 and the dataprocessing system 110 may not be subject to the restrictions specifiedby the CORS protocol. The request handler 264 may parse the initialrequest 125 for the address 256. The response rewriter 266 can use theaddress 256 to search for the embedded media content element 256″ fromthe media content database 272. The response rewriter 266 can in turntransmit the embedded media content element 256″ in the subsequentresponse to the client agent 252. The client agent 252 in turn canrender and play the embedded media content element 256″.

Using the terminal request 135, the request handler 264 can determinewhether the client agent 252 is configured to restrict cross-domainredirection. In some implementations, the request handler 264 canfurther parse the terminal request 135 to identify the predefinedidentifier to determine whether the client agent 262 is configured torestrict cross-domain redirection. Based on identifying the predefinedidentifier, the request handler 264 can determine that the client agent252 is configured to restrict cross-domain redirection. The requesthandler 264 can further determine that the client agent 252 may beexpecting the embedded media content element 256″ from other dataincluded in the terminal request 135.

In some implementations, the request handler 264 can parse the terminalrequest 135 to identify an application profile of the client agent 252(e.g., which type of web browser) to determine whether the client agent252 is configured to restrict cross-domain redirection. The requesthandler 264 can compare the application profile of the client agent 262to a list of applications configured to restrict cross-domainredirection. In some implementations, the list of applications may beaccessed by the request handler 264 from the memory 230 or anotherdatabase connected to the data processing system 110. If the applicationprofile of the client agent 252 matches one of the applications of thelist of applications, the request handler 264 can determine that theagent 252 is configured to restrict cross-domain redirection. In someimplementations, the request handler 264 can also determine that theclient agent 252 may be expecting the embedded media content element256″. If the application profile of the client agent 252 does not matchany of the applications on the list of applications, the request handler264 can determine that the client agent 252 is not configured torestrict cross-domain redirection.

In some implementations, the request handler 264 can parse the terminalrequest 135 to identify a device type of the client device 105 (e.g.,whether the client device 105 is a smart phone, laptop, or desktop,etc.) in determining whether the client agent 252 is configured torestrict cross-domain redirection. In some implementations, the requesthandler 264 can compare the device type of the client device 105 to alist of device types configured to restrict cross-domain redirection. Insome implementations, the list of device types may be accessed by therequest handler 264 from the memory 230 or another database connected tothe data processing system 110. If the device type of the client device105 matches one of the device types of the list of device types, therequest handler 264 can determine that the client agent 252 configuredto restrict cross-domain redirection. In some implementations, therequest handler 264 can also determine that the client agent 252 may beexpecting the embedded media content element 256″. If the device type ofthe client device 105 does not match any of the device types on the listof device types, the request handler 264 can determine that the clientagent 252 is not configured to restrict cross-domain redirection.

If the request handler 264 determines that the client agent 252 isconfigured to restrict cross-domain redirection, the request handler 264can determine which type of response the client agent 252 may beexpecting based on the content type header of the received request. Insome implementations, the request handler 264 can parse the terminalrequest 135 to identify the content type header. In someimplementations, the content type header may indicate which type ofcontent in the body of the response the client agent 252 may beexpecting. As explained above, the content type header may specifytextual or non-textual content. If the request handler 264 identifiesthat the content type header of the request specifies non-textual (suchas the case with the terminal request 135), the request handler 264 candetermine that the client agent 252 may be expecting the embedded mediacontent element 256″. In some implementations, the request handler 264can determine which type of method the initial request 115 correspondsto (e.g., OPTION, POST, or GET) to identify which type of response theclient agent 252 may be expecting. If the method of the initial requestis GET or POST, the request handler 264 may determine that the clientagent 252 may be expecting the embedded media content element. Theoperation of the request handler 264 in response to identifying thecontent type header of the request as textual (such as the case with theinitial request 115) is described in more detail above.

Once the request handler 264 identifies the content type header of therequest as specifying non-textual content, the request handler 264 canrelay, signal, or otherwise cause the response rewriter 266 to generatethe terminal response 145 to provide the client agent 252 with theembedded media content element 256″ corresponding to the redirectaddress 256′. The response rewriter 266 can set a header and a body ofthe terminal response 145. The header of the terminal response 145 canbe set to include a status code success (e.g., 200 OK). The header ofthe terminal response 145 can be set to include a content type headerindicating non-textual. To set the body of the initial response 125, theresponse rewriter 266 can access the media content database 272 tosearch for the embedded media content element 256″ using the redirectaddress 256′. The embedded media content element 256″ may be used by theclient agent 252 to render for the display on a display connected to theclient device 105. Once the embedded media content element 256″ isidentified, the response rewriter 266 can set, insert, or write theembedded media content element 256″ into the body of the terminalresponse 145. The response rewriter 266 can transmit the terminalresponse 145 via the network interface 225 to the client device 105.

In some implementations, the response rewriter 266 can include or insertexecutable code (e.g., for the media decoder 262) into the body of theterminal response 145 for instantiating a media player (e.g., usingFLASH or JAVASCRIPT) to render and play the embedded media contentelement 256″. Once executed at the client device 105, the executablecode in the terminal response 145 may convert the embedded media contentelement 256″ from first format (e.g., HTML video content element) to asecond format (e.g., JAVASCRIPT or HTML canvas content element). In someimplementations, the client device 105 or the client agent 252 may beconfigured to restrict or prohibit auto-playing of the embedded mediacontent element 256″ in the first format without authorization (e.g.,interaction with the embedded media content element 256″). On the otherhand, the client device 105 or the client agent 252 may be configured topermit auto-playing of the embedded media content element 256″ in thesecond format (e.g., without user interaction the embedded media contentelement 256″). In this manner, the terminal response 145 may circumventrestrictions specified by the client agent 252 on certain formatting ofmedia content, thereby improving the human-computer interaction (HCI)with the content elements embedded in the primary content element 254rendered at the client device 105. The response rewriter 266 cantransmit the terminal response 145 with the executable code via thenetwork interface 225 to the client device 105.

The media encoder 268 can encode the embedded media content element 256″prior to providing the embedded media content element 256″ to the clientagent 252. The media encoder 268 can convert the embedded media contentelement 256″ from a first format (e.g., HTML video content element) to asecond format (e.g., JAVASCRIPT or HTML canvas content element). In someimplementations, the client device 105 or the client agent 252 may beconfigured to restrict or prohibit auto-playing of the embedded mediacontent element 256″ in the first format without authorization (e.g.,interaction with the embedded media content element 256″). On the otherhand, the client device 105 or the client agent 252 may be configured topermit auto-playing of the embedded media content element 256″ in thesecond format (e.g., without user interaction the embedded media contentelement 256″).

Using various image processing algorithms, the media encoder 268 cantraverse the embedded video media content element 256″ encoded in thefirst format (e.g., HTML video content element) frame by frame toidentify one or more image objects in the frame. For each identifiedimage object at each frame, the media encoder 268 can then identify acorresponding one or more drawing functions to construct the embeddedmedia content element 256″ in the second format (e.g., JAVASCRIPT forinvoking HTML drawing functions for graphics in an HTML canvas contentelement, such as recto, fill( ), lineTo( ), and translate( ) functions,etc.). By arranging the drawing functions, the media encoder 268 cangenerate the embedded video media content element 256″ encoded in thesecond format. The media encoder 268 may transcode audio from theembedded video content element 256″ encoded in the first format into thesecond format. In some implementations, the media encoder 268 mayinclude a separate audio content element to be provided with theembedded video media content element 256″.

Once converted, the media encoder 268 can relay the embedded mediacontent element 256″ encoded in the second format to the responserewriter 266. In some implementations, the response rewriter 266 can inturn insert or include the embedded media content element 256″ encodedin the second format into the terminal response 145. In someimplementations, the response rewriter 266 can transmit the terminalresponse 145 with the embedded media content element 256″ encoded in thesecond format via the network interface 225 to the client device 105.

In determining whether to further encode the embedded content element256″, the response rewriter 266 can determine whether the client device105 (e.g., mobile smartphones) or the client agent 252 (e.g., webbrowser for smart phones) is configured to restrict auto playing of theembedded media content element 256″ encoded in the first format (e.g.,HTML video content element). The response rewriter 266 can determinewhether the client device 105 or the client agent 252 is configured torestrict the auto playing of the embedded media content element 256″when encoded in the first format based on the request (e.g., terminalrequest 135). The media encoder 268 in conjunction can encode theembedded media content element 256″ to another format that the clientdevice 105 or the client agent 252 is configured to permit auto playing.

In some implementations, the response rewriter 266 can parse theterminal request 135 to identify a device type identifier of the clientdevice 105. The response rewriter 266 can compare the device type of theclient device 105 to a list of device types configured to restrict autoplaying of the embedded media content element 256″ in the first format.If the device type of the client device 105 matches one of the devicetypes of the list of device types, the response rewriter 266 candetermine that the client device 105 is configured to restrict autoplaying of the embedded media content element 256″ in the first format.In some implementations, the media encoder 268 can encode or convert theembedded media content element 256″ from the first format to the secondformat. In some implementations, the response rewriter 266 can transmitthe terminal response 145 with the embedded media content element 256″encoded in the second format via the network interface 225 to the clientdevice 105. If the device type of the client device 105 does not matchany of the device types of the list of device types, the responserewriter 266 can determine that the client device 105 is configured topermit auto playing of the embedded media content element 256″ in thefirst format.

In some implementations, the response rewriter 266 can parse theterminal request 135 to identify an application profile of the clientagent 252. The response rewriter 266 can compare the application profileof the client agent 252 to a list of applications configured to restrictauto playing of the embedded media content element 256″ in the firstformat. If the application profile of the client agent 252 matches oneof the applications of the list of applications, the response rewriter266 can determine that the client agent 252 is configured to restrictauto playing of the embedded media content element 256″ in the firstformat. The media encoder 268 can encode, transcode, or otherwiseconvert the embedded media content element 256″ from the first format tothe second format. The response rewriter 266 can transmit the terminalresponse 145 with the embedded media content element 256″ encoded in thesecond format via the network interface 225 to the client device 105. Ifthe application profile of the client agent 252 does not matches any ofthe applications of the list of applications, the response rewriter 266can determine that the client agent 252 is configured to permit autoplaying of the embedded media content element 256″ in the first format.

In response to receipt of the terminal response 145 by the client agent252, the response parser 260 can parse the terminal response 145 toextract the embedded media content element 256″ from the body. Theresponse parser 260 can determine whether the body of the terminalresponse 145 includes the embedded media content element 256″ or theredirect address 256′ as discussed above. In some implementations, theresponse parser 260 can parse the terminal response 145 to identify thestatus code indicating success. In response to identifying the statuscode indicating success, the response parser 260 can extract theembedded media content element 256″ from the terminal response 145. Insome implementations, the response parser 260 can parse the terminalresponse 145 to identify the content type header. If the content typeheader of the terminal response 145 indicates non-textual, the responseparser 260 can determine that the body includes the embedded mediacontent element 256″ and extract the embedded media content element256″. The response parser 260 can relay the embedded media contentelement 256″ to the media decoder 262.

In some implementations, the response parser 260 can parse the terminalresponse 145 to further identify executable code in the body forinstantiating the media player to render and play the embedded mediacontent element 256″. The media player may have similar or the samefunctionality as the media decoder 262, and may include instructions forthe client agent 252 to convert the embedded media content element 256″from the first format to the second format. The first format may berestricted from automatic playback by the client agent 252, whereas thesecond format may be permitted to automatically play by the client agent252. Once identified, the response parser 260 can extract the executablecode from the body of the terminal response 145. The response parser 260can in turn cause the client agent 252 to execute the media player toplay and render the embedded media content element 256″.

With the embedded media content element 256″ extracted from the terminalresponse 145, the media decoder 262 can play and render the embeddedmedia content element 256″ on the client device 105. In someimplementations, the media decoder 262 may be a media player configuredto play video content (e.g., HTML video content elements) of the clientagent 252. In some implementations, the media decoder 262 may be ascript executable by the processor 235 of the client device 250 providedwith the primary content element 254. In some implementations, the mediadecoder 262 may be a script executable by the processor 235 of theclient device 250 of the embedded media content element 256″ provided bythe data processing system 110.

In some implementations, the response parser 260 can parse the terminalresponse 145 to further determine whether the embedded media contentelement 256″ is encoded in the first format or in the second format. Thefirst format may be restricted from automatic playback by the clientagent 252, whereas the second format may be permitted to automaticallyplay by the client agent 252. If the response parser 260 determines thatthe embedded media content element 256″ is encoded in the second format,the media decoder 262 or the client agent 252 can play and render theembedded media content element 256″ without any restrictions.

If the response parser 260 determines that the embedded media contentelement 256″ is encoded in the first format, the response parser 260 maysignal or relay to the media decoder 262 or the client agent 252 toconvert the embedded media content element 256 to the second format.Using various image processing algorithms, the media decoder 262 cantraverse the embedded video media content element 256″ encoded in thefirst format (e.g., HTML video content element) frame by frame toidentify one or more image object on the frame. For each identifiedimage object at each frame, the media encoder 268 can then identify acorresponding one or more drawing functions to construct the embeddedmedia content element 256″ in the second format (e.g., JAVASCRIPT forinvoking HTML drawing functions for graphics in an HTML canvas contentelement, such as recto, fill( ), lineTo( ), and translate( ) functions,etc.). By arranging the drawing functions, the decoder 262 can generatethe embedded video media content element 256″ encoded in the secondformat to allow the client agent 252 to auto-play.

Referring to FIGS. 3A-3C, illustrated is a flow diagram depicting amethod 300 of delivering cross-site auto-play media. The functionalitydescribed herein with respect to method 300 may be performed or executedby the system 200, such as the data processing system 110, the clientdevice 105, the content provider device 210, and the content publisherdevice 215 as shown on FIG. 2 or the system 400 as shown in FIG. 4 ,among others, or any combination thereof.

Starting from FIG. 3 A, the client device can identify embedded mediacontent element in a primary content element (Step 302). The primarycontent element may have been received by the client device, and mayinitially lack the embedded media content element. The primary contentelement may include an address to the embedded media content element. Insome implementations, primary content element may include an inlineframe (e.g., a content slot) for embedding the media content element.

In some implementations, the client device can identify an address ofthe embedded media content element (Step 304). The address for theembedded media content element may include a domain name and a pathname. The domain name for the embedded media content element mayreference a server different from the content publisher device thatprovided the primary content element.

The client device can identify an address of the primary content element(Step 306). The primary content element may be referenced by an address,such as one following the Uniform Resource Locator (URL) syntax. Theaddress may include a domain name and a path. The domain name may beassociated with or particular to the content publisher device. The pathmay refer to the particular primary content element hosted by thecontent publisher device.

The client device can determine whether the domain name of the embeddedmedia content element differs from the domain name of the primarycontent element (Step 308). If the domain name of the embedded mediacontent element does not differ from the domain name of the primarycontent element, the client device may execute the functionality at Step374 discussed below. In such a scenario, the lack of difference betweendomain names may indicate that the primary content element and theembedded media content element are to be provided by the same server.Communications between the client device and the server as such may befree from the restrictions specified by the CORS protocol.

On the other hand, if the domain name of the embedded media contentelement differs from the domain name of the primary content element, theclient device can generate a request with the two domain names (Step310). The request may be an HTTP request using the OPTION, POST, GET, orHEAD method. An origin header of the request may be set to the addressof the primary content element. A host header of the request may be setto the address of the embedded content element. In addition, the clientdevice can append a redirection indicator to the generated request (Step312). The redirection indicator may signal the server that the clientdevice is configured to restrict cross-domain content and may alsoindicate to the server that the client device may be expecting anotheraddress to be redirected to. In some implementations, the client devicecan insert the redirection indicator to the address of the embeddedcontent element in the host header of the request.

The client device can determine whether the request to be sent is theinitial request (Step 314). In some implementations, the client devicecan maintain a counter on the memory to track a number of requests forthe embedded media content element. If the counter is greater than one,the client device can determine that the request to be sent is not thefirst request. As the request is not the first to be sent, the clientdevice can set a content type header of the request to non-textual (Step316). Setting the content type header to non-textual may indicate to theserver that the client device is expecting the embedded media contentelement. If the counter is zero, the client device can determine thatthe request to be sent is the first request. As the request is the firstto be sent, the client device can set the content type header of therequest to textual (Step 318). Setting the content type header totextual may indicate to the server that the client device is expecting aredirect address for the embedded media content element. The clientdevice can transmit the request for the embedded media content elementto the server (Step 320).

The server can receive the request for the embedded media contentelement (Step 322). The server can identify the domain name of theprimary content element and the domain name of the embedded mediacontent element included in the request (Step 324). The server canidentify the address of the primary content element from the originheader of the request. The server can extract the domain name from theaddress of the primary content element. The server can identify theaddress of the embedded media content element from the host header ofthe request. The server can extract the domain name from the address ofthe embedded media content element.

The server can determine whether the domain name of the primary contentelement differs from the domain name of the embedded media contentelement (Step 326). If the two domain names do not differ from eachother, the server can proceed to execute the functionality of Step 380described below. On the other hand, if the two domain names differ fromeach other, the server can identify the redirection indicator includedin the request (Step 328). The server can determine whether the clientdevice is configured to restrict cross-domain content (Step 330). Insome implementations, using the request, the server can determinewhether the client device is expecting a redirection address or theembedded media content element inserted into the body of the response.If the client device is not configured to restrict cross-domain content,the server can proceed to execute the functionality of Step 380described below.

Referring now to FIG. 3B, if the client device is configured to restrictcross-domain content, the server can generate a response (Step 332). Theserver can set the status code of the response to success (Step 334).Under the CORS specification, if the server were to attempt to issue aresponse with a redirect status code including an address for embeddedcontent with a domain different from that of the primary contentelement, the origin header of the response may be set to null, therebyrestricting all domains in the redirect response. By setting the statuscode of the response to success, the server may bypass the restrictionsplaced by the CORS specification on responses with redirect statuscodes. The server can identify the content type header from the request(Step 336). The content type header may indicate which type of data toinclude into the response to be sent to the client device.

If the content type header of the request indicates textual, the servercan set the content type header of the response to textual (Step 340).Setting the content type header of the response to textual may indicateto the client device that the body of the response includes a redirectaddress for the embedded media content element. In some implementations,the server can access the media database for the redirect address forthe embedded media content element (Step 342). In some implementations,the server can insert the redirect address into the body of the response(Step 344). In some implementations, the server can increment a redirectcounter (Step 346). The server can maintain a counter on the memory totrack the number of redirects for the embedded media content element forthe client device. The server can insert the number of redirects to theresponse. The server can then transmit the response to the client device(Step 358).

If the content type header of the request indicates non-textual, theserver can set the content type header of the response to non-textual(Step 348). The server can access the media database for the embeddedmedia content element (Step 350). The server can determine whether theclient device is configured to restrict auto playing of the mediacontent (Step 352). The client device may be configured to restrictauto-playing of the embedded media content element if encoded in oneformat (e.g., HTML video content element), but permit auto-playing ifencoded in another format (e.g., HTML canvas content element). If theclient device is configured to restrict auto playing, the server canencode the embedded media content element (Step 354). The server canconvert the encoding of the embedded media content element (e.g., usingvarious image processing algorithms) from one format to another format.The server can insert the embedded media content element into the bodyof the response (Step 356). The server can then transmit the response tothe client device (Step 358).

The client device can receive the response from the server (Step 360).The client device can extract the body of the response (Step 362). Theclient device can determine whether the body of the response includesthe redirect address or the embedded media content element (Step 364).In some implementations, the client device can determine a type of dataincluded in the body of the response based on the content type header ofthe response.

If the body includes the redirect address for the embedded media contentelement, the client device can identify the redirect address (Step 366).In some implementations, if the content type header indicates textual,the client device may determine that the body includes the redirectaddress for the embedded media content element. The client device maythen re-execute the functionality of Step 310 as described herein, usingthe redirect address provided by the server as the host header of thenext request.

If the body includes the embedded media content element, the clientdevice can decode the embedded media content element (Step 368). In someimplementations, if the content type header indicates non-textual, theclient device may determine that the body includes the embedded mediacontent element. The client device can insert the embedded media contentelement onto the primary content element (Step 370). In someimplementations, the client device may decode the embedded media contentelement from one format to another format. The former format may berestricted by the client device from auto-play, whereas the latterformat may be permitted by the client device to auto-play. The clientdevice can then automatically play and render the embedded media contentelement on the primary content element (Step 372).

Referring now to FIG. 3C, if the domain name of the primary contentelement does not differ from the domain name of the embedded mediacontent element, the client device can generate a request with thesingle address (Step 374). The lack of difference between the domainname of the primary content element and the domain name of the embeddedmedia content element may imply that the server may be the same devicethat provided the client device with the primary content element. FromStep 374 onward, communications between the client device and the servermay be free from the restrictions specified by the CORS protocol. Theclient device can set an origin header of the request to the address ofthe primary content element. The client device can set a host header ofthe request to the address of the embedded media content element.

The client device can then transmit the request to the server (Step376). The server can receive the request from the client device (Step378). The server can identify the address from the request for theembedded media content element (Step 380). The server can parse therequest to identify the address in the host header of the request. Theserver can access the media database for media content at the address(Step 382). The server can insert the embedded media content elementinto the response (Step 384). The server can transmit the response tothe client device (Step 386). The client device can receive the responsefrom the server (Step 388). The client device can insert the embeddedmedia content element into the primary content element (Step 390). Theclient device can play and render the embedded media content elementinto the primary content element (Step 392).

FIG. 4 shows the general architecture of an illustrative computer system400 that may be employed to implement any of the computer systemsdiscussed herein (including the data processing system 110 and itscomponents such as the request handler 264, the response rewriter 266,and the media encoder 268 and the client device 105 and its componentssuch as the client agent 252, the primary content element 254, therequest writer 258, the response parser 260, and the media decoder 262)in accordance with some implementations. The computer system 400 can beused to provide information via the network 205 for display. Thecomputer system 400 of FIG. 4 comprises one or more processors 420communicatively coupled to memory 425, one or more communicationsinterfaces 405, and one or more output devices 410 (e.g., one or moredisplay units) and one or more input devices 415. The processors 420 canbe included in the data processing system 110 such as the requesthandler 264, the response rewriter 266, and the media encoder 268 andthe client device 105 and its components such as the client agent 252,the primary content element 254, the request writer 258, the responseparser 260, and the media decoder 262 among others.

In the computer system 400 of FIG. 4 , the memory 425 may comprise anycomputer-readable storage media, and may store computer instructionssuch as processor-executable instructions for implementing the variousfunctionalities described herein for respective systems, as well as anydata relating thereto, generated thereby, or received via thecommunications interface(s) or input device(s) (if present). Referringagain to the system 110 of FIG. 1 , the data processing system 110 caninclude the memory 425 to store information related to the availabilityof inventory of one or more content units, reservations of one or morecontent units, among others. The memory 425 can include the database140. The processor(s) 420 shown in FIG. 4 may be used to executeinstructions stored in the memory 425 and, in so doing, also may readfrom or write to the memory various information processed and orgenerated pursuant to execution of the instructions.

The processor 420 of the computer system 400 shown in FIG. 4 also may becommunicatively coupled to or control the communications interface(s)405 to transmit or receive various information pursuant to execution ofinstructions. In some implementations, the communications interface(s)405 may be coupled to a wired or wireless network, bus, or othercommunication means and may therefore allow the computer system 400 totransmit information to or receive information from other devices (e.g.,other computer systems). While not shown explicitly in the system ofFIG. 2 , one or more communications interfaces facilitate informationflow between the components of the system 400. In some implementations,the communications interface(s) may be configured (e.g., via varioushardware components or software components) to provide a website as anaccess portal to at least some aspects of the computer system 400. Thecommunications interfaces 405 may include user interfaces (e.g., webpages), through which the user can communicate with the data processingsystem 110.

The output devices 410 of the computer system 400 shown in FIG. 4 may beprovided to allow various information to be viewed or otherwiseperceived in connection with execution of the instructions. In someimplementations, the input device(s) 415 may be provided to allow a userto make manual adjustments, make selections, enter data, or interact inany of a variety of manners with the processor during execution of theinstructions. Additional information relating to a general computersystem architecture that may be employed for various systems discussedherein is provided further herein.

Implementations of the subject matter and the operations described inthis specification can be implemented in digital electronic circuitry,or in computer software embodied on a tangible medium, firmware, orhardware, including the structures disclosed in this specification andtheir structural equivalents, or in combinations of one or more of them.Implementations of the subject matter described in this specificationcan be implemented as one or more computer programs, i.e., one or moremodules of computer program instructions, encoded on computer storagemedium for execution by, or to control the operation of, data processingapparatus. The program instructions can be encoded on anartificially-generated propagated signal, e.g., a machine-generatedelectrical, optical, or electromagnetic signal that is generated toencode information for transmission to suitable receiver apparatus forexecution by a data processing apparatus. A computer storage medium canbe, or be included in, a computer-readable storage device, acomputer-readable storage substrate, a random or serial access memoryarray or device, or a combination of one or more of them. Moreover,while a computer storage medium is not a propagated signal, a computerstorage medium can include a source or destination of computer programinstructions encoded in an artificially-generated propagated signal. Thecomputer storage medium can also be, or be included in, one or moreseparate physical components or media (e.g., multiple CDs, disks, orother storage devices).

The features disclosed herein may be implemented on a smart televisionmodule (or connected television module, hybrid television module, etc.),which may include a processing module configured to integrate internetconnectivity with more traditional television programming sources (e.g.,received via cable, satellite, over-the-air, or other signals). Thesmart television module may be physically incorporated into a televisionset or may include a separate device such as a set-top box, Blu-ray orother digital media player, game console, hotel television system, andother companion device. A smart television module may be configured toallow viewers to search and find videos, movies, photos and othercontent on the web, on a local cable TV channel, on a satellite TVchannel, or stored on a local hard drive. A set-top box (STB) or set-topunit (STU) may include an information appliance device that may containa tuner and connect to a television set and an external source ofsignal, turning the signal into content which is then displayed on thetelevision screen or other display device. A smart television module maybe configured to provide a home screen or top level screen includingicons for a plurality of different applications, such as a web browserand a plurality of streaming media services, a connected cable orsatellite media source, other web “channels”, etc. The smart televisionmodule may further be configured to provide an electronic programmingguide to the user. A companion application to the smart televisionmodule may be operable on a mobile computing device to provideadditional information about available programs to a user, to allow theuser to control the smart television module, etc. In alternateimplementations, the features may be implemented on a laptop computer orother personal computer, a smartphone, other mobile phone, handheldcomputer, a tablet PC, or other computing device.

The operations described in this specification can be implemented asoperations performed by a data processing apparatus on data stored onone or more computer-readable storage devices or received from othersources.

The terms “data processing apparatus”, “data processing system”, “userdevice” or “computing device” encompasses all kinds of apparatus,devices, and machines for processing data, including a programmableprocessor, a computer, a system on a chip, or multiple ones, orcombinations, of the foregoing, among others. The apparatus can includespecial purpose logic circuitry, e.g., an FPGA (field programmable gatearray) or an ASIC (application-specific integrated circuit). Theapparatus can also include, in addition to hardware, code that createsan execution environment for the computer program in question, e.g.,code that constitutes processor firmware, a protocol stack, a databasemanagement system, an operating system, a cross-platform runtimeenvironment, a virtual machine, or a combination of one or more of them.The apparatus and execution environment can realize various differentcomputing model infrastructures, such as web services, distributedcomputing and grid computing infrastructures. The request handler 264,the response rewriter 266, and the media encoder 268 can include orshare one or more data processing apparatuses, computing devices, orprocessors. The client agent 252, the primary content element 254, therequest writer 258, the response parser 260, and the media decoder 262can include or share one or more data processing apparatuses, computingdevices, or processors.

A computer program (also known as a program, software, softwareapplication, script, or code) can be written in any form of programminglanguage, including compiled or interpreted languages, declarative orprocedural languages, and it can be deployed in any form, including as astand-alone program or as a module, component, subroutine, object, orother unit suitable for use in a computing environment. A computerprogram may, but need not, correspond to a file in a file system. Aprogram can be stored in a portion of a file that holds other programsor data (e.g., one or more scripts stored in a markup languagedocument), in a single file dedicated to the program in question, or inmultiple coordinated files (e.g., files that store one or more modules,sub-programs, or portions of code). A computer program can be deployedto be executed on one computer or on multiple computers that are locatedat one site or distributed across multiple sites and interconnected by acommunication network.

The processes and logic flows described in this specification can beperformed by one or more programmable processors executing one or morecomputer programs to perform actions by operating on input data andgenerating output. The processes and logic flows can also be performedby, and apparatuses can also be implemented as, special purpose logiccircuitry, e.g., an FPGA (field programmable gate array) or an ASIC(application-specific integrated circuit).

Processors suitable for the execution of a computer program may include,both general and special purpose microprocessors, and any one or moreprocessors of any kind of digital computer. Generally, a processor willreceive instructions and data from a read-only memory or a random accessmemory or both. The essential elements of a computer are a processor forperforming actions in accordance with instructions and one or morememory devices for storing instructions and data. Generally, a computerwill also include, or be operatively coupled to receive data from ortransfer data to, or both, one or more mass storage devices for storingdata, e.g., magnetic, magneto-optical disks, or optical disks. However,a computer need not have such devices. Moreover, a computer can beembedded in another device, e.g., a mobile telephone, a personal digitalassistant (PDA), a mobile audio or video player, a game console, aGlobal Positioning System (GPS) receiver, or a portable storage device(e.g., a universal serial bus (USB) FLASH drive). Devices suitable forstoring computer program instructions and data include all forms ofnon-volatile memory, media and memory devices, including semiconductormemory devices such as EPROM, EEPROM, and flash memory devices; magneticdisks, e.g., internal hard disks or removable disks; magneto-opticaldisks; and CD-ROM and DVD-ROM disks. The processor and the memory can besupplemented by, or incorporated in, special purpose logic circuitry.

To provide for interaction with a user, implementations of the subjectmatter described in this specification can be implemented on a computerhaving a display device, e.g., a CRT (cathode ray tube), plasma, or LCD(liquid crystal display) monitor, for displaying information to the userand a keyboard and a pointing device, e.g., a mouse or a trackball, bywhich the user can provide input to the computer. Other kinds of devicescan be used to provide for interaction with a user as well. Feedbackprovided to the user can include any form of sensory feedback, e.g.,visual feedback, auditory feedback, or tactile feedback; and input fromthe user can be received in any form, including acoustic, speech, ortactile input. In addition, a computer can interact with a user bysending documents to and receiving documents from a device that is usedby the user, such as by sending web pages to a web browser on a user'sclient device in response to requests received from the web browser.

Implementations of the subject matter described in this specificationcan be implemented in a computing system that includes a back-endcomponent, e.g., as a data server, or that includes a middlewarecomponent, e.g., an application server, or that includes a front-endcomponent, e.g., a client computer having a graphical user interface ora Web browser through which a user can interact with an implementationof the subject matter described in this specification, or anycombination of one or more such back-end, middleware, or front-endcomponents. The components of the system can be interconnected by anyform or medium of digital data communication, e.g., a communicationnetwork. Communication networks can include a local area network (“LAN”)and a wide area network (“WAN”), an inter-network (e.g., the Internet),and peer-to-peer networks (e.g., ad hoc peer-to-peer networks).

The computing system such as system 400 or system 110 can includeclients and servers. In some implementations, the data processing system110 can include one or more servers in one or more data centers orserver farms. A client and server are generally remote from each otherand typically interact through a communication network. The relationshipof client and server arises by virtue of computer programs running onthe respective computers and having a client-server relationship to eachother. In some implementations, a server transmits data (e.g., an HTMLpage) to a client device (e.g., for purposes of displaying data to andreceiving user input from a user interacting with the client device).Data generated at the client device (e.g., a result of the userinteraction) can be received from the client device at the server.

While this specification contains many specific implementation details,these should not be construed as limitations on the scope of anyinventions or of what may be claimed, but rather as descriptions offeatures specific to particular implementations of the systems andmethods described herein. Certain features that are described in thisspecification in the context of separate implementations can also beimplemented in combination in a single implementation. Conversely,various features that are described in the context of a singleimplementation can also be implemented in multiple implementationsseparately or in any suitable subcombination. Moreover, althoughfeatures may be described above as acting in certain combinations andeven initially claimed as such, one or more features from a claimedcombination can in some cases be excised from the combination, and theclaimed combination may be directed to a subcombination or variation ofa subcombination.

Similarly, while operations are depicted in the drawings in a particularorder, this should not be understood as requiring that such operationsbe performed in the particular order shown or in sequential order, orthat all illustrated operations be performed, to achieve desirableresults. In some cases, the actions recited in the claims can beperformed in a different order and still achieve desirable results. Inaddition, the processes depicted in the accompanying figures do notnecessarily require the particular order shown, or sequential order, toachieve desirable results.

In certain circumstances, multitasking and parallel processing may beadvantageous. Moreover, the separation of various system components inthe implementations described above should not be understood asrequiring such separation in all implementations, and it should beunderstood that the described program components and systems cangenerally be integrated together in a single software product orpackaged into multiple software products. In some implementations, therequest handler 264, the response rewriter 266, and the media encoder268 can be part of the data processing system 110, a single module, alogic device having one or more processing modules, one or more servers,or part of a search engine. In some implementations, the client agent252, the primary content element 254, the request writer 258, theresponse parser 260, the media decoder 262 can be part of the dataprocessing system 110, a single module, a logic device having one ormore processing modules, one or more servers, or part of a searchengine.

Having now described some illustrative implementations andimplementations, it is apparent that the foregoing is illustrative andnot limiting, having been presented by way of example. In particular,although many of the examples presented herein involve specificcombinations of method acts or system elements, those acts and thoseelements may be combined in other ways to accomplish the sameobjectives. Acts, elements and features discussed only in connectionwith one implementation are not intended to be excluded from a similarrole in other implementations or implementations.

The phraseology and terminology used herein is for the purpose ofdescription and should not be regarded as limiting. The use of“including” “comprising” “having”

“containing” “involving” “characterized by” “characterized in that” andvariations thereof herein, is meant to encompass the items listedthereafter, equivalents thereof, and additional items, as well asalternate implementations consisting of the items listed thereafterexclusively. In one implementation, the systems and methods describedherein consist of one, each combination of more than one, or all of thedescribed elements, acts, or components.

Any references to implementations or elements or acts of the systems andmethods herein referred to in the singular may also embraceimplementations including a plurality of these elements, and anyreferences in plural to any implementation or element or act herein mayalso embrace implementations including only a single element. Referencesin the singular or plural form are not intended to limit the presentlydisclosed systems or methods, their components, acts, or elements tosingle or plural configurations. References to any act or element beingbased on any information, act or element may include implementationswhere the act or element is based at least in part on any information,act, or element.

Any implementation disclosed herein may be combined with any otherimplementation, and references to “an implementation,” “someimplementations,” “an alternate implementation,” “variousimplementation,” “one implementation” or the like are not necessarilymutually exclusive and are intended to indicate that a particularfeature, structure, or characteristic described in connection with theimplementation may be included in at least one implementation. Suchterms as used herein are not necessarily all referring to the sameimplementation. Any implementation may be combined with any otherimplementation, inclusively or exclusively, in any manner consistentwith the aspects and implementations disclosed herein.

References to “or” may be construed as inclusive so that any termsdescribed using “or” may indicate any of a single, more than one, andall of the described terms.

Where technical features in the drawings, detailed description or anyclaim are followed by reference signs, the reference signs have beenincluded for the sole purpose of increasing the intelligibility of thedrawings, detailed description, and claims. Accordingly, neither thereference signs nor their absence have any limiting effect on the scopeof any claim elements.

The systems and methods described herein may be embodied in otherspecific forms without departing from the characteristics thereof.Although the examples provided herein relate to delivering cross-siteauto-play media, the systems and methods described herein can includeapplied to other environments. The foregoing implementations areillustrative rather than limiting of the described systems and methods.Scope of the systems and methods described herein is thus indicated bythe appended claims, rather than the foregoing description, and changesthat come within the meaning and range of equivalency of the claims areembraced therein.

What is claimed:
 1. A method for presenting cross-site auto-play media,the method comprising: receiving, by a client device, a content elementassociated with a first domain, the content element comprising anidentifier of a media content element; determining, by the clientdevice, that the media content element is associated with a seconddomain different from the first domain; generating, by the client deviceand in response to determining that the media content element isassociated with a second domain different from the first domain, arequest with two domain names, the request including a predefinedidentifier indicating that the client device is configured to restrictcross-domain redirection; determining, by the client device, that therequest is subsequent to an initial request; setting, by the clientdevice and based on the determining that the request is subsequent tothe initial request, a content-type header of the request to anon-textual content-type header; transmitting, by the client device to adata processing system associated with the first domain, the request;receiving, by the client device from the data processing system, aresponse to the request; inserting, by the client device and based oncontents of the response, the media content element into primarycontent; and presenting, by the client device, the media content elementon the primary content.
 2. The method of claim 1, further comprising:extracting a body of the response from the contents of the response; anddetermining whether the body includes the media content element or aredirect address.
 3. The method of claim 2, wherein the body includesthe media content element, further comprising: decoding the mediacontent element.
 4. The method of claim 2, wherein the response is asubsequent response and the body of the subsequent response includes themedia content element, further comprising: transmitting, to the dataprocessing system, the initial request; receiving, from the dataprocessing system, an initial response including the redirect address;and identifying the redirect address for the media content element;wherein the transmitting the request is responsive to the identifying.5. The method of claim 1, wherein the response is a subsequent response,further comprising: determining that an initial response identifies adomain different from the first domain and is configured to redirect theclient device; and discarding the initial response.
 6. A system forpresenting cross-site auto-play media, the system comprising: a clientdevice comprising a network interface, a display device, and one or moreprocessors, the one or more processors configured to: receive a contentelement associated with a first domain, the content element comprisingan identifier of a media content element; determine that the mediacontent element is associated with a second domain different from thefirst domain; generate, in response to determining that the mediacontent element is associated with a second domain different from thefirst domain, a request with two domain names, the request including apredefined identifier indicating that the client device is configured torestrict cross-domain redirection; determine that the request issubsequent to an initial request; set, based on the determining that therequest is subsequent to the initial request, a content-type header ofthe request to a non-textual content-type header; transmit, to a dataprocessing system associated with the first domain, the request;receive, from the data processing system, a response to the request;insert, based on contents of the response, media content element intoprimary content; and present the media content element on the primarycontent.
 7. The system of claim 6, wherein the one or more processorsare further configured to: extract a body of the response from thecontents of the response; and determine whether the body includes themedia content element or a redirect address.
 8. The system of claim 7,wherein the body includes the media content element and the one or moreprocessors are further configured to: decode the media content element.9. The system of claim 7, wherein the response is a subsequent responseand the body of the subsequent response includes the media contentelement, and further wherein the one or more processors are furtherconfigured to: transmit, to the data processing system, the initialrequest; receive, from the data processing system, an initial responseincluding the redirect address; and identify the redirect address forthe media content element; wherein the transmitting the request isresponsive to the identifying.
 10. The system of claim 6, wherein theresponse is a subsequent response and the one or more processors arefurther configured to: determine that an initial response identifies adomain different from the first domain and is configured to redirect theclient device; and reject the initial response.
 11. A non-transitorycomputer readable medium comprising instructions for presentingcross-site auto-play media that, when executed by one or more processorsof a computing device, cause the device to: receive a content elementassociated with a first domain, the content element comprising anidentifier of a media content element; determine that the media contentelement is associated with a second domain different from the firstdomain; generate, in response to determining that the media contentelement is associated with a second domain different from the firstdomain, a request with two domain names, the request including apredefined identifier indicating that the device is configured torestrict cross-domain redirection; determine that the request issubsequent to an initial request; set, based on the determining that therequest is subsequent to the initial request, a content-type header ofthe request to a non-textual content-type header; transmit, to a dataprocessing system associated with the first domain, the request;receive, from the data processing system, a response to the request;insert, based on contents of the response, media content element intoprimary content; and present the media content element on the primarycontent.
 12. The computer readable medium of claim 11, furthercomprising instructions that, when executed by the one or moreprocessors of the computing device, further cause the device to: extracta body of the response from the contents of the response; and determinewhether the body includes the media content element or a redirectaddress.
 13. The computer readable medium of claim 12, wherein the bodyincludes the media content element and further comprising instructionsthat, when executed by the one or more processors of the computingdevice, further cause the device to: decode the media content element.14. The computer readable medium of claim 12, wherein the response is asubsequent response and the body of the subsequent response includes themedia content element, and further comprising instructions that, whenexecuted by the one or more processors of the computing device, furthercause the device to: transmit, to the data processing system, theinitial request; receive, from the data processing system, an initialresponse including the redirect address; and identify the redirectaddress for the media content element; wherein the transmitting therequest is responsive to the identifying.